<?php

/**
 * Plant form.
 *
 * @package    seth
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class PlantForm extends BasePlantForm
{
  public function configure()
  {
      //Field Type
      $this->widgetSchema['type'] = new sfWidgetFormChoice(array('choices'=>Doctrine_Core::getTable('Plant')->getTypes()));
      $this->validatorSchema['type'] = new sfValidatorChoice(array('choices'=>array_keys(Doctrine_Core::getTable('Plant')->getTypes()))); 
      
      //Field Structure
      $this->widgetSchema['structure'] = new sfWidgetFormChoice(array('choices'=>Doctrine_Core::getTable('Plant')->getStructures()));
      $this->validatorSchema['structure'] = new sfValidatorChoice(array('choices'=>array_keys(Doctrine_Core::getTable('Plant')->getStructures()))); 
      
      //Field Enable
      $this->widgetSchema['enable'] = new sfWidgetFormChoice(array('choices'=>array(1=>'True',0=>'False')));
      $this->validatorSchema['enable'] = new sfValidatorChoice(array('choices'=>array_keys(array('True','False')))); 
      
      //helper
      $this->widgetSchema->setHelp('owner','Can\'t find the right owner? Create ');
      $this->widgetSchema->setHelp('enable','True will enable the visualization and the monitoring of the plant');
  }
}
